"""一个用来表示汽车的类"""
class Car:
    """模拟一辆汽车"""
    def __init__(self,make,model,year):
        """初始化"""
        self.make = make
        self.model = model
        self.year = year
        self.odometer_reading = 0

    def get_descriptive_name(self):
        """返回格式规范的描述信息"""
        long_name = f"{self.year} {self.make} {self.model}"
        return long_name

    def read_odometer(self):
        """打印里程信息"""
        print(f"This car has {self.odometer_reading} miles on it")

    def update_odometoer(self,mileage):
        """将里程表更新为指定值
        禁止回调"""
        if mileage >= self.odometer_reading:
            self.odometer_reading = mileage
        else:
            print("You can't roll back an odometer!")

    def increment_odometer(self,miles):
        """让里程表读数增加指定的量"""
        self.odometer_reading += miles

    def fill_gas_tank(self):
        """给子类重写做例子"""
        print("加满油！")